package com.lagou;

import com.lagou.quartz.LoadBalancing;
import com.lagou.rpc.RegisterService;
import com.lagou.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Enumeration;


@SpringBootApplication()
public class ServerBoot {

    public static void main(String[] args) throws Exception {

//        //启动服务器
        SpringApplication.run(ServerBoot.class, args);

        UserServiceImpl.startServer(args[0],Integer.valueOf(args[1]));
        String serverName = "/com.lagou.server";
        RegisterService.reg(serverName,args[0],args[1]);
        LoadBalancing.doJob();


    }

}
